(window.webpackJsonp = window.webpackJsonp || []).push([[15], {
    1652: function (e, t) { },
    1653: function (e, t) { },
    1654: function (e, t) { },
    1655: function (e, t) { },
    1676: function (e, t, n) {
        "use strict";
        n.r(t);
        var r = n(9)
            , a = n.n(r)
            , i = n(0)
            , o = n.n(i)
            , s = n(3)
            , u = n.n(s)
            , c = n(21)
            , d = n(91)
            , h = n(169)
            , f = n(247)
            , p = n(108)
            , g = n(1648)
            , P = n.n(g)
            , l = n(747)
            , v = n(1662);
        function m (e, t, n, r, a, i, o) {
            try {
                var s = e[i](o)
                    , u = s.value
            } catch (c) {
                return void n(c)
            }
            s.done ? t(u) : Promise.resolve(u).then(r, a)
        }
        function w (e) {
            return function () {
                var t = this
                    , n = arguments;
                return new Promise((function (r, a) {
                    var i = e.apply(t, n);
                    function o (e) {
                        m(i, r, a, o, s, "next", e)
                    }
                    function s (e) {
                        m(i, r, a, o, s, "throw", e)
                    }
                    o(void 0)
                }
                ))
            }
        }
        function y (e, t) {
            return (y = Object.setPrototypeOf || function (e, t) {
                return e.__proto__ = t,
                    e
            }
            )(e, t)
        }
        P.a.GlobalWorkerOptions.workerSrc = v.a;
        var k = window.devicePixelRatio
            , b = function (e) {
                var t, n;
                function r () {
                    var t;
                    return (t = e.call(this) || this).state = {
                        pdf: null,
                        currentPage: 1,
                        canvasWidth: 900,
                        lastRenderedWidth: 900,
                        activeLayer: "primary"
                    },
                        t.listener = function (e) {
                            t.renderPdf()
                        }
                        ,
                        t.renderPdf = w(a.a.mark((function e () {
                            var n, r, i, o, s, u, c;
                            return a.a.wrap((function (e) {
                                for (; ;)
                                    switch (e.prev = e.next) {
                                        case 0:
                                            if (n = t.props,
                                                r = n.document,
                                                i = n.fallbackRenderer,
                                                o = n.getPdfUrl,
                                                s = t.state.currentPage,
                                                window.Worker) {
                                                e.next = 5;
                                                break
                                            }
                                            return i({
                                                reason: "Workers are not supported"
                                            }),
                                                e.abrupt("return");
                                        case 5:
                                            return e.prev = 5,
                                                t.worker && !t.worker.destroyed || (t.worker = new P.a.PDFWorker({
                                                    name: "pdfjs-worker"
                                                })),
                                                e.next = 9,
                                                o({
                                                    document: r
                                                });
                                        case 9:
                                            if (u = e.sent,
                                                !t.unmounted) {
                                                e.next = 12;
                                                break
                                            }
                                            return e.abrupt("return");
                                        case 12:
                                            return e.next = 14,
                                                t.loadPdf(u);
                                        case 14:
                                            if (c = e.sent,
                                                !t.unmounted) {
                                                e.next = 17;
                                                break
                                            }
                                            return e.abrupt("return");
                                        case 17:
                                            s > c.numPages && (s = c.numPages),
                                                t.props.onPaginationChange({
                                                    currentPage: s - 1,
                                                    totalPagesCount: c.numPages
                                                }),
                                                t.setState({
                                                    pdf: c,
                                                    currentPage: s
                                                }, (function () {
                                                    t.renderPage(s)
                                                }
                                                )),
                                                e.next = 25;
                                            break;
                                        case 22:
                                            e.prev = 22,
                                                e.t0 = e.catch(5),
                                                "RenderingTimeoutError" === e.t0.name ? i({
                                                    reason: "Rendering timeout exceeded"
                                                }) : (i({
                                                    reason: "Runtime error",
                                                    message: e.t0.toString()
                                                }),
                                                    p.a.log(e.t0));
                                        case 25:
                                        case "end":
                                            return e.stop()
                                    }
                            }
                            ), e, null, [[5, 22]])
                        }
                        ))),
                        t.loadPdf = function (e) {
                            return P.a.getDocument({
                                url: e,
                                worker: t.worker
                            }).promise
                        }
                        ,
                        t.setCanvasSize = function (e) {
                            var n = e.width
                                , r = e.height
                                , a = t.primaryCanvas.current
                                , i = t.secondaryCanvas.current;
                            a.width = n,
                                a.height = r,
                                i.width = n,
                                i.height = r
                        }
                        ,
                        t.primaryCanvas = o.a.createRef(),
                        t.secondaryCanvas = o.a.createRef(),
                        t.isBusy = !1,
                        t.isPending = !1,
                        t
                }
                n = e,
                    (t = r).prototype = Object.create(n.prototype),
                    t.prototype.constructor = t,
                    y(t, n);
                var i = r.prototype;
                return i.componentDidMount = function () {
                    f.a.on(f.a.RESUME_PREVIEW_RELOAD_EVENT, this.listener),
                        this.renderPdf()
                }
                    ,
                    i.componentDidUpdate = function (e) {
                        !e.document && this.props.document && this.renderPdf()
                    }
                    ,
                    i.componentWillUnmount = function () {
                        this.unmounted = !0,
                            this.worker && (this.worker.destroy(),
                                delete this.worker),
                            f.a.removeListener(f.a.RESUME_PREVIEW_RELOAD_EVENT, this.listener)
                    }
                    ,
                    i.renderPage = function (e) {
                        var t = this;
                        if (this.isBusy)
                            this.isPending = !0;
                        else {
                            this.isBusy = !0;
                            var n = this.props
                                , r = n.width
                                , a = n.onPageRender
                                , i = this.state.pdf;
                            i && i.getPage(e).then((function (e) {
                                var n = e.getViewport({
                                    scale: 1
                                })
                                    , a = r * k / n.width
                                    , i = e.getViewport({
                                        scale: a
                                    });
                                t.state.canvasWidth !== i.width && t.setCanvasSize(i),
                                    t.setState({
                                        canvasWidth: i.width,
                                        lastRenderedWidth: r
                                    });
                                var o = t.primaryCanvas.current
                                    , s = t.secondaryCanvas.current
                                    , u = "primary" === t.state.activeLayer ? s : o;
                                return e.render({
                                    canvasContext: u.getContext("2d"),
                                    viewport: i
                                }).promise
                            }
                            )).then((function () {
                                var e = "primary" === t.state.activeLayer ? "secondary" : "primary";
                                t.setState({
                                    activeLayer: e
                                }),
                                    a && a(),
                                    t.isBusy = !1,
                                    t.isPending && t.renderPage(t.state.currentPage),
                                    t.isPending = !1
                            }
                            )).catch((function (e) {
                                return p.a.log(e)
                            }
                            ))
                        }
                    }
                    ,
                    i.nextPage = function () {
                        var e = this
                            , t = this.state
                            , n = t.currentPage
                            , r = t.pdf
                            , a = n + 1;
                        this.props.onPaginationChange({
                            currentPage: a - 1,
                            totalPagesCount: r.numPages
                        }),
                            this.setState({
                                currentPage: a
                            }, (function () {
                                e.renderPage(a)
                            }
                            ))
                    }
                    ,
                    i.previousPage = function () {
                        var e = this
                            , t = this.state
                            , n = t.currentPage
                            , r = t.pdf
                            , a = n - 1;
                        this.props.onPaginationChange({
                            currentPage: a - 1,
                            totalPagesCount: r.numPages
                        }),
                            this.setState({
                                currentPage: a
                            }, (function () {
                                e.renderPage(a)
                            }
                            ))
                    }
                    ,
                    i.reset = function () {
                        var e = this
                            , t = this.state.pdf;
                        this.props.onPaginationChange({
                            currentPage: 0,
                            totalPagesCount: t.numPages
                        }),
                            this.setState({
                                currentPage: 1
                            }, (function () {
                                e.renderPage(1)
                            }
                            ))
                    }
                    ,
                    i.resize = function () {
                        var e = this.props.width
                            , t = this.state
                            , n = t.currentPage;
                        e - t.lastRenderedWidth > 50 && this.renderPage(n)
                    }
                    ,
                    i.render = function () {
                        var e = this.props.width
                            , t = this.state
                            , n = t.canvasWidth
                            , r = t.activeLayer
                            , a = e / n;
                        return o.a.createElement(o.a.Fragment, null, o.a.createElement(l.d, {
                            ref: this.primaryCanvas,
                            ratio: a,
                            visible: "primary" === r
                        }), o.a.createElement(l.e, {
                            ref: this.secondaryCanvas,
                            ratio: a,
                            visible: "secondary" === r
                        }))
                    }
                    ,
                    r
            }(i.Component);
        b.propTypes = {
            width: u.a.number,
            height: u.a.number,
            document: u.a.object,
            onPaginationChange: u.a.func,
            onPageRender: u.a.func,
            getPdfUrl: u.a.func.isRequired,
            fallbackRenderer: u.a.func
        };
        t.default = Object(c.connect)(null, (function (e) {
            return {
                fallbackRenderer: function (t) {
                    return e(d.actions.fallback(t))
                },
                getPdfUrl: Object(h.a)(e, d.actions.fetchClientPreview)
            }
        }
        ), null, {
            forwardRef: !0
        })(b)
    }
}]);
